<?php

$__sessionManagerInitialized = false;
$_session_savepath = "/tmp/utblog";

function initSession()
{
	//if sessionMnagager has already been initialized, return at once
	global $__sessionManagerInitialized;
	if($__sessionManagerInitialized)
		return true;

	global $_session_savepath;
	//session_cache_limiter( "public" );
	ini_set("session.cookie_path", '/galaxytool');
	
	// init_alter, alias of init_set
	// default value of session.gc_maxlifetime which is set in php.ini, is 1440 seconds (24 minutes);
	ini_alter("session.gc_maxlifetime", 14400);
	
	// todo: create the session save folder firstly
	if(!empty($_session_savepath) && file_exists($_session_savepath)) {
		ini_alter("session.save_path", $_session_savepath);
	}
	
	session_name('galaxytool');
	session_start();

	// inform the other methods that the session manager has already been intialized
	global $__sessionManagerInitialized;
	$__sessionManagerInitialized = true;
}

?>